﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Time
{
    class Program
    {
        static void Main(string[] args)
        {

            //日期DateTime
            var eew = DateTime.Now;

            var lse = "2014-12-01";

            var ls=Convert.ToDateTime(lse);

            var w = DateTime.Parse(lse);

            var hel = w.AddDays(-1);
            Console.WriteLine(hel);



            //字符串
            string str = "你妈喊你回家吃饭";

            //查找字符串
            var es = str.IndexOf('回');
            Console.WriteLine(es);

            if (str.LastIndexOf('回') == es)
            {
                Console.WriteLine("回字只出现了一回");
            }
            else
            {
                Console.WriteLine("出现了不止一次");
            }


            //替换Replace
            Console.WriteLine(str.Replace("妈","爸"));


            //截取字符串Substring
            Console.WriteLine(str.Substring(2));
            Console.WriteLine(str.Substring(2,1));


            //插入字符串Insert
            Console.WriteLine(str.Insert(str.Length,"啊"));
        }
    }
}
